1. Field of the Invention
The invention relates generally to the field of digital image processing and digital image understanding and more particularly to a process and system for automatically creating cropped and zoomed versions of photographic images.
2. Description of the Related Art
For many decades, traditional commercial photo-finishing systems have placed limits on the features offered to consumers to promote mass production. Among those features that are unavailable conventionally, zooming and cropping have been identified by both consumers and photofinishers as extremely useful additional features that could potentially improve the quality of the finished photos and the subsequent picture sharing experiences. With the advent of, and rapid advances in digital imaging, many of the technical barriers that existed in traditional photography no longer stand insurmountable.
Hybrid and digital photography provide the ability to crop undesirable content from a picture, and magnify or zoom the desired content to fill the entire photographic print. In spite of the fact that some traditional cameras with zoom capability provide consumers greater control over composing the desired scene content, studies have found that photographers may still wish to perform a certain amount of cropping and zooming when viewing the finished photograph at a later time. Imprecise viewfinders of many point-and-shoot cameras, as well as simply second-guessing their initial compositions, are factors in the desirability of zoom and crop. In addition, it maybe desirable to use some other regular border templates such as ovals, heart shapes, squares, etc. In another scenario, some people commonly referred to as xe2x80x9cscrapbookersxe2x80x9d tend to perform more aggressive crop in making a scrapbook, e.g., cutting along the boundary of objects.
There are significant differences in objectives and behaviors between these two types of cropping, namely album-making and scrapbook making, with the latter more difficult to understand and summarize. The invention described below performs automatic zooming and cropping for making photographic prints. One customer focus group study indicated that it would be beneficial to provide customers a double set of printsxe2x80x94one regular and one zoom. Moreover, it is preferred that the cropping and zooming be done automatically. Most customers do not want to think about how the zooming and cropping is being done as long as the content and quality (e.g., sharpness) of the cropped and zoomed pictures are acceptable.
There has been little research on automatic zoom and crop due to the apparent difficulty involved in performing such a task. None of the known conventional image manipulation software uses scene content in determining the automatic crop amount. For example, a program entitles xe2x80x9cXVxe2x80x9d, a freeware package developed by John Bradley at University of Pennsylvania, USA (Department of Computer and Information Science), provides an xe2x80x9cautocropxe2x80x9d function for manipulating images and operates in the following way:
1. The program examines a border line of an image, in all of the four directions, namely from the top, bottom, left and right sides;
2. The program checks the variation within the line. In grayscale images, a line has to be completely uniform to be cropped. In color images, both the spatial correlation and spectral correlation have to be low, except for a small percentage of pixels, for the line to be qualified for cropping. In other words, a line will not be cropped if it contains a significant amount of variation;
3. If a line.along one dimension passes the criterion, the next line (row or column) inward is then examined; and
4. The final cropped image is determined when the above recursive process stops.
This program essentially tries to remove relatively homogeneous margins around the borders of an image. It does not examine the overall content of the image. In practice, the XV program is effective in cropping out the dark border generated due to imprecise alignment during the scanning process. However, disastrous results can often be produced due to the apparent lack of scene understanding. In some extreme cases, the entire image can be cropped.
Another conventional system, described by Bollman et al. in U.S. Pat. No. 5,978,519 (incorporated herein by reference), provides a method for cropping images based upon the different intensity levels within the image. With this system, an image to be cropped is scaled down to a grid and divided into non-overlapping blocks. The mean and variance of intensity levels are calculated for each block. Based on the distribution of variances in the blocks, a threshold is selected for the variance. All blocks with a variance higher than the threshold variance are selected as regions of interest. The regions of interest are then cropped to a bounding rectangle. However, such a system is only effective when uncropped images contain regions where intensity levels are uniform and other regions where intensity levels vary considerably. The effectiveness of such a system is expected to be comparable to that of the XV program. The difference is that the XV program examines the image in a line by line fashion to identify uniform areas, while U.S. Pat. No. 5,978,519 examines the image in a block by block fashion to identify uniform areas. In summary, both techniques cannot deal with images with non-uniform background.
The major drawback of conventional techniques is that they do not provide a system for having photographs automatically cropped or zoomed based upon the main subject in the image except, using expensive manual techniques.
The invention comprises a method and computer program for cropping a digital image that includes inputting a belief map of an image, selecting a zoom factor and a crop window, clustering regions of the belief map to identify background portions, secondary portions and main portions, positioning the crop window such that the crop window is centered around a main portion having a highest belief value, moving the crop window such that the crop window is included completely within the image, moving the crop window such that a sum of belief values is at a maximum, and cropping the image according to the crop window.
The invention moves the crop window such that the crop window includes all of the main region having the highest belief value, and/or includes a buffer (margin) around the main region having the highest belief value. The clustering includes setting the background portions to a zero belief value.
The invention can also repeat the positioning process and the moving processes with a rotated image and determine if the rotated image produces a higher sum of beliefs. Similarly, the invention can repeat the processes with a second zoom factor and a second crop window and determine if the second zoom factor and the second crop window produce a higher sum of beliefs than of the first zoom factor and the first crop window (and a lower sum of belief outside the crop window).
In another embodiment the invention is a system for cropping an image that includes an input for receiving a belief map of an image, a selector choosing a crop window, a window mover positioning the crop window such that the crop window is centered around a portion of the belief map having a highest belief value, and a cropper modifying the image according to the crop window.
The invention may include a second selector selecting a zoom factor and a comparator clustering regions of the belief map into belief categories. The comparator sets portions of the belief map having a lowest belief value to a zero belief value.
The window mover moves the crop window such that the crop window is included completely within the image, such that a sum of belief values is at a maximum, such that the crop window includes all of the region having the highest belief value, or such that the crop window includes a buffer around the region having the highest belief value. Also, the window mover may repeat the moving processes with a rotated image and determine if the rotated image produces a higher sum of beliefs or repeat the positioning process and the moving processes with a rotated image and determine if the rotated image produces a higher sum of beliefs. Similarly, the selector, window mover and cropper can repeat the processes with a second crop window and determine if the second crop window produces a higher sum of beliefs.
One advantage of the invention lies in the ability to automatically crop and zoom photographic images based upon the scene contents. With the invention of the main subject of the image is identified and the cropping and zooming is performed around this main subject. Therefore, the invention produces high-quality zoomed or crops images automatically, regardless whether the background is uniform or not.